<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>渐变</title>
    <style>
        body{
            height: 2500px;
        }
        .box{
            width: 800px;
            height: 400px;
            outline: 1px solid red;
            margin: 0 auto;
        }
        .b1{
            background-image: linear-gradient(to right,green 10%,red 30%,blue 60%,yellow 90%);
        }
        .b2{
            background-image: repeating-linear-gradient(to right,green ,red 20px,blue 40px);
        }
        .b3{
            background-image: repeating-linear-gradient(to bottom,gray,gray 10px,white 10px,white 20px);
        }
    </style>
</head>
<body>
    <div class="box b1">

    </div>
    <div class="box b2">

    </div>
    <div class="box b3">

    </div>
</body>
</html>